package com.yonyou.cyxdms.sysAuth.service.controller.manage.menu;


import com.yonyou.cyxdms.sysAuth.service.service.permission.PermissionMenuActionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 菜单类相关
 *
 * @author maxingjian
 * @since 2019/7/9
 */

@Api(value = "MenuController", tags = {"菜单类相关"})
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private PermissionMenuActionService permissionMenuActionService;

    /**
     * 销售顾问下拉数据
     *
     * @param
     * @return java.util.List<Map>
     * @author maxingian
     * @since 2019/10/16
     */
    @ApiOperation(value = "公共菜单按钮权限")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "userId", name = "userId", required = true, dataType = "string", paramType = "header")
    })
    @GetMapping("/menuAction")
    public List<Map<String, Object>> menuAction() {
        return permissionMenuActionService.getMenuAction();
    }

    /**
     * 销售顾问下拉数据
     *
     * @param
     * @return java.util.List<Map>
     * @author maxingian
     * @since 2019/10/16
     */
    @ApiOperation(value = "人员菜单按钮权限")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "userId", name = "userId", required = true, dataType = "string", paramType = "header")
    })
    @GetMapping("/menuUserAction")
    public List<Map<String, Object>> menuUserAction() {
        return permissionMenuActionService.getPermissioinMenuAction();
    }

}
